import request from '../utils/request'

//编辑列表
export function editPermissions(data) {
  return request({
    url: '/user/edit_permissions',
    method: 'post',
    data
  })
}

//权限列表   -- web/移动端 0-web 1-移动端
export function permissionsList(data) {
  return request({
    url: '/user/permissions_list',
    method: 'get',
    params:data
  })
}

//权限判断
export function permissionsFlag(data) {
  return request({
    url: '/user/permissions_flag',
    method: 'get',
    params:data
  })
}

//用户列表 
export function userList(data) {
  return request({
    url: '/user/user_list',
    method: 'post',
    data
  })
}

// 权限复制用户列表
export function userListCopy(data) {
  return request({
    url: '/user/user_list_o',
    method: 'post',
    data
  })
}

// 复制权限
export function copyPermissions(data) {
  return request({
    url: '/user/copy_permissions',
    method: 'post',
    data
  })
}

//部门列表 
export function depList(data) {
  return request({
    url: '/user/dep_list',
    method: 'post',
    data
  })
}

//部门操作
export function depHandle(data) {
  return request({
    url: '/user/dep_handle',
    method: 'post',
    data
  })
}

// 用户操作
export function userHandle(data) {
  return request({
    url: '/user/user_handle',
    method: 'post',
    data
  })
}

// 重置密码
export function resetPwd(data) {
  return request({
    url: '/user/reset_pwd',
    method: 'post',
    data
  })
}

// 导出
export function userExport(data) {
  return request({
      responseType: 'blob',
      url: '/user/export',
      method: 'get',
      params:data
  })
}

//工厂信息
export function factoryMess(data) {
  return request({
    url: '/user/factory_mess',
    method: 'post',
    data
  })
}

//工厂信息修改
export function factoryEdit(data) {
  return request({
    url: '/user/factory_edit',
    method: 'post',
    data
  })
}

// 导入==========
export function excelImport(data) {
  return request({
    responseType: 'blob',
    url: '/user/excel_import',
    method: 'post',
    params:data
  })
}